<template>
  <div class="echarts-outer-wrapper flex-cloumn width-410">
    <Title title="业务办理" time="1" text=""></Title>
    <div class="content-wrapper flex1" @click="viewRecords($event)">
      <vue-seamless-scroll
        :data="swiperListLeftBomArr"
        :class-option="classOptionBomArr"
        class="list-wrapper"
      >
        <div
          class="item-wrapper"
          v-for="(item, index) in swiperListLeftBomArr"
          :key="index"
        >
          <div class="wrapper">
            <div class="time">{{ item.tjsj }}</div>
            <div class="content">{{ item.nr }}</div>
            <div class="dian button-wrapper" :data="JSON.stringify(item)">
              ...
            </div>
          </div>
        </div>
      </vue-seamless-scroll>
      <div class="echart-detail-modal" v-show="ModalShow">
        <div class="title">{{ ModalTitle }}</div>
        <div class="close" @click="incomeLeaver">X</div>
        <div
          class="detail-list center"
          v-if="ModalList && ModalList.length !== 0"
        >
          <div class="item">纳税人识别号</div>
          <div class="item">纳税人名称</div>
          <div class="item money" v-if="ModalList[0].je">金额</div>
        </div>
        <div
          class="detail-list-wrapper"
          v-if="ModalList && ModalList.length !== 0"
        >
          <div
            class="detail-list center"
            v-for="(item, index) in ModalList"
            :key="index"
          >
            <div class="item">{{ item.nsrsbh }}</div>
            <div class="item">{{ item.nsrmc }}</div>
            <div class="item money" v-if="item.je">{{ item.je }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Title from "@/components/title";

export default {
  name: "sstjzx",
  components: {
    Title,
  },
  data() {
    return {
      swiperListLeftBomArr: [],
      classOptionBomArr: {
        limitMoveNum: 1, // 开启无缝滚动的数据量
        singleHeight: 30,
        waitTime: 1,
        step: 0.5,
        hoverStop: true,
      },
      ModalShow: false,
      ModalTitle: "",
      ModalList: "",
    };
  },
  created() {},
  mounted() {
    this.ajax({
      url: "/dpzsSycxService/sstjzxQuery",
      method: "post",
      data: {
        param: {},
      },
    }).then((res) => {
      res = res.data;
      if (res.rtnCode !== "200") {
        this.$message.error(res.rtnMsg);
        return;
      }
      this.swiperListLeftBomArr = res.data.tjList;
    });
  },
  methods: {
    oldProofBtn() {
      window.location.href = "http://68.12.74.3/idf/invoiceChecking";
    },
    viewRecords(e) {
      const path = e.path || (e.composedPath && e.composedPath());
      let target = path.filter((r) => /button-wrapper/.test(r.className));
      if (target.length) target = target[0];
      else return;
      const data = JSON.parse(target.getAttribute("data")); // 单项数据详情
      // 跳转详情页面
      this.ajax({
        url: "/dpzsSycxService/sstjzxmxQuery",
        method: "post",
        data: {
          param: { lx: data.lx },
        },
      }).then((res) => {
        res = res.data;
        if (res.rtnCode !== "200") {
          this.$message.error(res.rtnMsg);
          return;
        }
        let data = res.data.mxList;
        this.ModalTitle = "详情";
        this.ModalList = data;
        this.ModalShow = true;
      });
    },
    incomeLeaver() {
      this.ModalShow = false;
      this.ModalTitle = "";
    },
  },
};
</script>

<style scoped lang="scss">
.echarts-outer-wrapper {
  width: 458px;
  height: 314px;
  .list-wrapper {
    height: 256px;
    overflow: hidden;
    .item-wrapper {
      padding: 5px 40px;
      &:nth-child(2n) .content {
        background: rgba(31, 141, 151, 0.4);
        border-radius: 10px;
      }
      &:nth-child(2n + 1) .content {
        background: rgba(53, 87, 184, 0.4);
        border-radius: 10px;
      }
      .wrapper {
        position: relative;
        height: 20px;
        display: flex;
        align-items: center;
        .time {
          width: 100px;
          text-align: center;
          background-image: url(~@/assets/images/bg-sub-title.png);
          background-size: 100% 100%;
          font-size: 16px;
          color: #9fe5ff;
        }
        .content {
          padding-left: 10px;
          flex: 1;
          font-size: 16px;
          color: #ffffff;
        }
        .dian {
          position: absolute;
          right: 12px;
          top: -10px;
          font-size: 20px;
          color: #ffffff;
          cursor: pointer;
        }
      }
    }
  }
  .content-wrapper {
    position: relative;
  }
}
</style>
